package com.wangjie.prefixsum;

/**
 * @author jieshao
 * @date 2022/3/31 10:22
 */
public class PrefixSumBase {
    private int[] num;

    public PrefixSumBase(int[] num) {
        this.num = num;
    }

    public int sumRange(int left, int right) {
        int res = 0;
        for (int i = left; i <= right; i++) {
            res += num[i];
        }
        return res;
    }
}